package cn.tedu.mapper;

import cn.tedu.pojo.entiry.Product;
import org.apache.ibatis.annotations.*;

 /* @author Justin Parker
 * @author 2024/8/3 下午9:59
 * @version 1.0
 */
@Mapper
public interface ProductMapper {


    @Insert("insert into product(title,price,stock) values(#{title},#{price},#{stock})")
    int insertProduct(Product product);

    @Update("update product set title=#{title},price=#{price},stock=#{stock} where title=#{title}")
    int updateProduct(Product product);

    @Delete("delete from product where title=#{title}")
    int deleteProduct(Product product);

    @Select("select * from product where title=#{title}")
    Product selectProduct(String title);

}
